<?php
include_once('../../include/init.php');
include(DIR_ROOT_P.'/include/checklogin.php');
include(DIR_ROOT_P.'/header.php');

$action=fs_get_value("do");
switch($action)
{
	case	"exam_result"	:	get_result()	;	break;
	default					:	main()			;	break;
}
?>
<?php
function main(){
	global $db;
?>
<div class="content">
    <?php include(DIR_ROOT_P.'/html_middle_left.php');?>  
	<div class="content_right">
		<div class="main_exam" style="OVERFLOW-y:auto;overFlow-x: hidden;">
			<?php
				$sql = "select * from ".TABLE_DEPARTMENT." where 1 = 1";
				$result_department = $db -> query($sql);
				while($row_department=$db->fetch_array($result_department)){
			?>
                        <fieldset style="width: 200; color: #B7B7B7; border-style: groove" align="center"> 
                        <legend style="font-size:15px;color: red; border: 1 solid #000000"> <?php echo ($row_department['name'])?></legend> 
                        <table width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                <?php
                                        $sql = "select * from ".TABLE_MEMBER." where type in('1','2') and departmentid = '".$row_department['id']."' ";
                                        $result = $db -> query($sql);
                                        $i=0;
                                        while($row=$db->fetch_array($result)){
                                                if($i%10 == 0){
                                                        echo "</tr><tr>";
                                                }$i++;
                                ?>
				<td style="width:10%;height: 35px"  title=点击查看该教师课件 ><a  href="<?php echo(DIR_ROOT_A);?>/main/exam/list/?exam_type_1=1&exam_charge=2&exam_class=<?php echo($row['class_id']);?>" target="_self"><?php echo($row['realname']);?></a></td>
                                <?php
                                        }
                                ?>
                                </tr>
                        </table>
                      </fieldset><br>
                                <?php
				}
                                ?>
		</div>
  
                        
                        
                        
                 </div>
	</div>

<?php
}
include(DIR_ROOT_P.'/bottom.php');
?>